A process is a fundamental entity of control within a computer system. A process comprises a set of executable code, i.e., a program, and private data space, i.e., allocated memory. Memory is allocated to a process when the process is created in the computer system. In many computer systems, a process is constrained to use only the memory that it was allocated at its creation. This makes it simple to ensure that a process does not mis-use another process' memory. Illustratively, a memory map is created, that shows which portions of memory are assigned to which processes, and this map is used to detect any attempt by a process to access memory that is not allocated to that process. An example of such a system is disclosed in U.S. Pat. No. 4,356,550 (see cols. 61-72).
Dynamic memory allocation computer systems are a class of computer systems that allow an executing process to request allocation of additional memory for its exclusive use during execution, and to request that no-longer needed dynamically-allocated memory be deallocated and thereby freed for use by other processes. Mis-use of memory that had once been allocated to a process and now is allocated to a different process may be detected through the memory-map mechanism referred to above. However, this mechanism is not capable of detecting memory mis-use within a process, and indeed failures of dynamic memory allocation computer systems commonly result from incorrect use of dynamically allocated memory. These failures can be catastrophic to the end user, and expensive for the system developer to find and eliminate. Particularly common and difficult to discover is the error where memory that was once dynamically allocated to a function, routine, procedure, or some other subprogram within a process, continues to be referenced by that subprogram after it has freed that memory. If that memory has been allocated to another subprogram subsequently to being freed by the first subprogram and the first subprogram writes the memory, the second subprogram's data stored in the memory will be destroyed and the second subprogram will use the wrong data, causing unpredictable behavior. And if the first subprogram reads the memory after the second subprogram has written it, the first subprogram's data stored in the memory will have been destroyed, and the first subprogram will use the wrong data, also causing unpredictable behavior.
These errors may cause a process to produce incorrect results without giving any indication that anything is wrong. But even if these errors cause the process to crash, finding the cause of the crash may be next-to-impossible due to the dynamic nature of the system, which will likely cause the error to manifest itself only occasionally and in different places during repeat iterations of execution of the process. These consequences of the dynamic nature of the system make conventional tools--conventional debuggers, tracers, memory dump analyzers, and system test procedures, to name a few--particularly inadequate to find the sources of these errors or to detect that the potential for such errors even exists in the system.